<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page language="java" import="Domain.Employee"%>
<%@ page language="java" import="java.util.List"%>
<%@ page language="java" import="Dao.impl.EmployeeDaoImpl"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>addEmployee</title>
</head>
<body>
	<table border="1px">
		<tr>
			<th>员工姓名</th>
			<th>员工性别</th>
			<th>员工年龄</th>
			<th>所属部门</th>
			<th>所在职务</th>
			<th>工龄</th>
			<th>修改操作</th>
			<th>删除操作</th>
		</tr>
		<%
			EmployeeDaoImpl edi=new EmployeeDaoImpl();
			List<Employee> emps=edi.getEmployee();
			for (Employee employee : emps) {
		%>
		<tr>
			<td><%=employee.getName() %></td>
			<td><%=employee.getSex() %></td>
			<td><%=employee.getAge() %></td>
			<td><%=employee.getDapartment() %></td>
			<td><%=employee.getType() %></td>
			<td><%=employee.getYear() %></td>	
			<td><a href="http://localhost:8080/Homework/updateEmployee.jsp?year=<%=employee.getYear() %>&&type=dapartment=<%=employee.getType()%>&&<%=employee.getDapartment()%>&&age=<%=employee.getAge()%>&&sex=<%=employee.getSex()%>&&name=<%=employee.getName()%>&&&&type=update&&id=<%=employee.getId()%>">修改</a></td>
			<td><a href="http://localhost:8080/Homework/EmployeeServlet?&&type=delete&&id=<%=employee.getId()%>">删除</a></td>	
		</tr>
		<%} %>
		<tr>
		<td><a href="http://localhost:8080/Homework/addEmployee.jsp">新增员工信息</a></td>
		</tr>
	</table>
</body>
</html>